from flask import Blueprint

from models.entity.point import Point
from utils.result import result

mod = Blueprint("core_point", __name__, url_prefix="/core/point", template_folder="templates", static_folder="static")

@mod.route("/get_points/", methods=["GET", "POST"])
def get_all_point():
    all_points = Point().get_list_all()
    # print('all_points',all_points)
    rdic = {}
    rdic["data"] = []
    for item in all_points:
        #   注意序列化 ,字典和费字典的转换
        rdic["data"].append(item.to_dict())
    return result(data=rdic["data"])